package cn.hwh.springframework;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author wenhao hu
 * @title: BeanFactory
 * @projectName mini-spring
 * @description: TODO
 * @date 2022/1/2410:51
 */
public class BeanFactory {
    private Map<String,BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>();

    public Object getBean(String name){
        return beanDefinitionMap.get(name).getBean();
    }

    public void registerBeanDefinition(String name,BeanDefinition beanDefinition){
        beanDefinitionMap.put(name,beanDefinition);
    }
}
